﻿{% extends "gma/base.html" %}
{% load static %}

<!-- CONTENT
  =====================================================================-->

{% block content %}

<div class="page__hd">
    <h1 class="page__title">
        <i class="fa fa-chart-line weui_grid_icon_fa" style="font-size: 32px"> </i> 市场营销
    </h1>
</div>

<div class="page__bd">
    <div class="weui-cells__title"> <i class="fa fa-filter"></i> 筛选条件 </div>
    <div class="weui-cells">
        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd">
                <label for="" class="weui-label"> <p> <i class="fab fa-app-store-ios gm_menu_item_icon"></i> 产品 </p> </label>
            </div>
            <div class="weui-cell__bd">
                <select class="weui-select" name="channel" id="channel">
                    {% for app in apps %}
                        <option value="{{ app }}">{{ app }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>
    </div>

    <div class="weui-cells__title"> <i class="fa fa-users"></i> 新增用户 </div>
    <div class="weui-cells">
        {% for item in new_users %}
        <a class="weui-cell weui-cell_access" href="{% url 'gma:new_user_chart_in_channel_detail' item.channel %}">
            <div class="weui-cell__hd">
                <i class="fa fa-users"></i> {{ item.channel }}
            </div>
            <div class="weui-cell__bd">  </div>
            <div class="weui-cell__ft"> {{ item.value }} 人 </div>
        </a>
        {% endfor %}
    </div>

    <div class="weui-cells__title"> <i class="fa fa-money-bill-alt"></i> 充值金额 </div>
    <div class="weui-cells">
        {% for item in pay_data %}
        <a class="weui-cell weui-cell_access" href="{% url 'gma:pay_chart_in_channel_detail' item.channel %}">
            <div class="weui-cell__bd">
                 <i class="fa fa-money-bill-alt"></i> {{ item.channel }}
            </div>
            <div class="weui-cell__ft"> ￥{{ item.value }} </div>
        </a>
        {% endfor %}
    </div>
</div>

<div class="page__ft">
    <a href="{% url 'gma:home' %}">
        <span class="bottom-logo">
           HiBao
       </span>
    </a>
</div>

{% endblock content %}


<!-- SCRIPT
  =====================================================================-->

{% block extra_js %}
<script src="{% static 'js/clipboard.min.js' %}"></script>

<script>
var clipboard = new ClipboardJS('.copy-btn');

clipboard.on('success', function(e) {
    show_toast("已复制到粘贴板");
    e.clearSelection();
});

clipboard.on('error', function(e) {
    show_toast(e.action);
});
</script>
{% endblock extra_js %}